<html>
<head>
    <meta charset="utf-8">
    <title>丁丁麻将 - 充值结果</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<!--    <meta http-equiv="refresh" content="3">-->
    <link rel="apple-touch-icon" href="../../../images/favicon.ico" />
    <link rel="icon" href="../../../images/favicon.ico" />
    <link rel="stylesheet" href="../../../css/weuix.min.css" type="text/css" />
    <link rel="stylesheet" href="../../../css/custom.css" type="text/css" />
    <script type="text/javascript" src="../../../js/jquery.min.js"></script>
    <script type="text/javascript" src="../../../layer/layer.js"></script>
    <style type="text/css">
        .page-bg {
            background: url(../../../images/pgbg.jpg) no-repeat center center;
            background-size: 100% 100%;
            padding: 0 10px;
        }

        img.cell_img {
            background: #a56c95;
            background: -moz-linear-gradient(30deg, #a56c95, #2b1102, #d7a4da);
            background: -webkit-linear-gradient(30deg, #a56c95, #2b1102, #d7a4da);
            background: linear-gradient(30deg, #a56c95, #2b1102, #d7a4da);
            border: 0 none;
            border-radius: 5px;
            box-shadow: 4px 4px 8px rgba(0,0,0,.5);
            margin: 0;
        }

        .weui-form-preview {
            border: 0 none;
            box-shadow: 0 0 8px 4px rgba(0,0,0,.21);
            padding-left: 15px;
            padding-right: 15px;
        }

        .weui-form-preview-btn .icon {
            font-size: 18px;
        }
    </style>

</head>
<body ontouchstart class="page-bg">
<div class="weui-share" id="share_weixin">
    <div class="weui-share-box">
        点击右上角请使用手机浏览器打开继续操作！<i></i>
    </div>
</div>

<div class="weui_msg">
    <div class="weui_icon_area">
        <div class="weui_icon_area"><img src="<?= urldecode($product['ProductImages'])?>" alt="<?= $product['ProductName']?>" onerror="javascript:this.src='../../../images/holder.png'" class="cell_img"></div>
    </div>
    <div id="content"></div>
    <div class="weui-form-preview">
        <div class="weui-form-preview-hd">
            <label class="weui-form-preview-label">付款金额</label>
            <em class="weui-form-preview-value f-red">&#165;<?= $order['Amount']?></em>
        </div>
        <div class="weui-form-preview-bd">
            <p>
                <label class="weui-form-preview-label">玩家</label>
                <span class="weui-form-preview-value"><?= $user['PlayerName']?> 〔<?= $user['PlayerID']?>〕</span>
            </p>
            <p>
                <label class="weui-form-preview-label">礼包</label>
                <span class="weui-form-preview-value"><?= $product['ProductName']?></span>
            </p>
            <p>
                <label class="weui-form-preview-label">订单</label>
                <span class="weui-form-preview-value"><?= $order['OrderId']?></span>
            </p>
            <p>
                <label class="weui-form-preview-label">时间</label>
                <span class="weui-form-preview-value"><?= ($order['PayStatus'] == 1) ? $order['PayDate'] : '---' ?></span>
            </p>
        </div>
        <div class="weui-form-preview-ft">
            <a class="weui-form-preview-btn weui-form-preview-btn-default" href="/pay/order-list?userid=<?= $order['UserId']?>"><i class="icon icon-51"></i>&nbsp;查看账单</a>
        </div>
    </div>
</div>
<div class="weui-footer weui-footer-fixed-bottom">
    <p class="weui-footer-links">
        <a href="javascript:;" class="weui-footer-link">武汉百游网络科技有限公司</a>
    </p>
    <p class="weui-footer__text">Copyright &copy; <script>
            document.write(new Date().getFullYear())
        </script> baiyouyx.com</p>
</div>
</body>
</html>
<script language="JavaScript">
    $(document).ready(function () {
        setTimeout(payResult(),2000);
        function payResult() {
            $.ajax({
                cache: false,
                type: "POST",
                url: '/pay/return-result-url',
                data: {'out_trade_no' : '<?= $order['OrderId']?>'},
                beforeSend: function(XMLHttpRequest) {
                    layer.load();
                },
                success: function(data) {
                    layer.closeAll('loading');
                    html = '<div class="weui_text_area">';
                    if (data['PayStatus'] == 1){
                        html += '<h2 class="weui_msg_title f-orange"><i class="weui_icon_success"></i>&nbsp;充值成功！</h2>\n' +
                            '            <p class="weui_msg_desc">充值结果，已支付 </p>';

                    }else {
                        html += '<h2 class="weui_msg_title f-orange"><i class="weui_icon_warn"></i>&nbsp;充值失败！</h2>\n' +
                            '            <p class="weui_msg_desc">充值结果，未支付 </p>';
                    }
                    html += '</div>';
                    $("#content").html(html);
                }
            });
        }
    });
</script>